package cn.echo.ecc.service.impl;

import cn.echo.ecc.domain.CourseCollect;
import cn.echo.ecc.mapper.CourseCollectMapper;
import cn.echo.ecc.mapper.CourseMapper;
import cn.echo.ecc.service.ICourseCollectService;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Arrays;
import java.util.List;

/**
 * <p>
 * 商品收藏 服务实现类
 * </p>
 *
 * @author hulan
 * @since 2022-09-30
 */
@Service
public class CourseCollectServiceImpl extends ServiceImpl<CourseCollectMapper, CourseCollect> implements ICourseCollectService {

    @Override
    public List<CourseCollect> selectListByTypeName(String typeName) {
        Wrapper<CourseCollect> wrapper = new EntityWrapper<>();
        wrapper.eq("type_name",typeName).groupBy(true,"user_id");
        return selectList(wrapper);
    }
}
